#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;
using ll = long long;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 2e6 + 10;
const int mod = 998244353;
const int inv2 = (mod + 1) >> 1;

int n,m,K,deg[N],u[N],v[N],ans;

int upd(int x) { return x + (x >> 31 & mod); }

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in,m = in,K = in; rep(i, 1, m) u[i] = in,v[i] = in,deg[u[i]]++,deg[v[i]]++;
	rep(i, 1, K) {
		int x = in;
		int d1 = deg[u[x]],d2 = deg[v[x]];
		ans = upd(ans + 1ll * (d1 - 1) * inv2 % mod - mod);
		ans = upd(ans + 1ll * (d2 - 1) * inv2 % mod - mod);
		ans = upd(ans + 2 - mod);
	}
	cout << ans << endl; return 0;
}
